<!DOCTYPE html>
<html lang="en">
<head>
 <meta charset="UTF-8">
 <title>Title</title>
 <style>
  .box{
   width:100px;
   height:100px;
   background:red;
  }
 </style>
 <script>

     function Touch(ele){
         var _this=this;
         this.ele=ele;
         this.transP={
             x:0,
             y:0
         };
         this.events={
             handleEvent:function(event){
                 switch(event.type){
                     case 'touchstart':
                         _this.start(event);
                         break;
                     case 'touchmove':
                         _this.move(event);
                         break;
                     case 'touchend':
                         _this.end(event);
                         break;
                 }
             }
         }
     }

     Touch.prototype={

         start:function(ev){
             var touches=ev.targetTouches[0],
                 _this=this;
             this.disP={
                 x:touches.pageX-this.transP.x,
                 y:touches.pageY-this.transP.y,
                 id:touches.identifier
             };
             console.log('aaa');
             _this.ele.addEventListener('touchmove',_this.events,false);
             _this.ele.addEventListener('touchend',_this.events,false);
         },
         move:function(ev){

             var touches=ev.targetTouches[0];
             if(touches.identifier== this.disP.id){
                 console.log('move');
                 this.transP={
                     x:touches.pageX-this.disP.x,
                     y:touches.pageY-this.disP.y
                 };
                 this.ele.style.transform='translate3d('+this.transP.x+'px,'+this.transP.y+'px,0)';
                 this.ele.style.Webkittransform='translate3d('+this.transP.x+'px,'+this.transP.y+'px,0)';
             }
         },
         end:function(ev){
             ev=ev||window.event;
             var _this=this;
             if(ev.changedTouches[0].identify==this.disP.id){
                 _this.ele.removeEventListener('touchmove',_this.events,false);
                 _this.ele.removeEventListener('touchend',_this.events,false);
             }

         },
         init:function(){
             var _this=this;
             this.ele.addEventListener('touchstart',_this.events,false);
         }
     };
     window.onload=function(){
         var box=document.querySelector('#box'),
             touch=new Touch(box);

         touch.init();

     };
 </script>
</head>
<body>
<div id="box" class="box"></div>
</body>
</html>